<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>CSRF 跨站请求</title>

    <!-- 引入 JQuery -->
    <script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>

    <script type="text/javascript">
        $(function () {
            $("#btn_jsonp").click(function () {
                $.ajax({
                    url: "http://localhost:8080/jsonp/getInfo", //请求地址
                    type: "GET",
                    success: function (data) {
                        //返回的jsonp数据必须是 json 格式
                        console.log("success：" + JSON.stringify(data));
                    },
                    error: function (data) {
                        console.log("error：" + JSON.stringify(data));
                    }
                })
            });
        });
    </script>
</head>
<body>
<button id="btn_jsonp" type="button" style="font-size: 20px">CorsFilter 跨域请求</button>
</body>
</html>